#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2015-10-14 19:36:00
# @Author  : Kang.cunhua (358608208@qq.com)
# @Link    : https://git.oschina.net/mdr/
# @Version : $Id$

# 小练习4 ：存10000块钱，年利率是3.25%，求多少年之后，存款能翻番
im = 10000
iy = 0
while im < 20000:
    im *= 1 + 0.0325
    iy += 1

print 'need: ' + str(iy) + 'years'
# need: 22years

# 练习8 getMax2vauleofList
# 作业：
# 一个序列[1,2,3,2,12,3,1,3,21,2,2,3,4111,22,3333,444,111,4,5,777,65555,45,33,45]
# 求这个list的最大的两个值
l = [1, 2, 3, 2, 12, 3, 1, 3, 21, 2, 2, 3, 4111, 22,
     3333, 444, 111, 4, 5, 777, 65555, 45, 33, 45]
l.sort()
print 'max' + str(l[-1])
# max65555
print '2max:' + str(l[-2])
# In [6]: 2max:4111
#
# 练习，list的长度
l = ['td', 'pc', 'comper', 'wa']
print l
print str(len(l))
# pc', 'comper', 'wa']
print l
print str(len(l))
# pc', 'comper', 'wa']
print l
print str(len(l))
# pc', 'comper', 'wa']
print l
print str(len(l))
# pc', 'comper', 'wa']
print l
print str(len(l))
